<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Calico: calico/sensors/gyroscope_models.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Calico
   </div>
   <div id="projectbrief">A visual-inertial calibration library designed for rapid problem construction and debugging.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_e7ac338090e46d594d3ea7a0e9efc7ba.html">calico</a></li><li class="navelem"><a class="el" href="dir_a7e6fdbe7254e0dadcd82a69dc076109.html">sensors</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">gyroscope_models.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef CALICO_SENSORS_GYROSCOPE_MODELS_H_</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define CALICO_SENSORS_GYROSCOPE_MODELS_H_</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;calico/typedefs.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160; </div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160; </div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;absl/status/statusor.h&quot;</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;absl/strings/str_cat.h&quot;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;Eigen/Dense&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacecalico_1_1sensors.html">calico::sensors</a> {</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">   16</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> : int {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;  <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da35c3ace1970663a16e5c65baa5941b13">kNone</a>,</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da34e2be26dca2101fb95fc6487800e928">kGyroscopeScaleOnly</a>,</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;  <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22daebca3599d4b156ca2c552501c98cfd21">kGyroscopeScaleAndBias</a>,</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da81a678b12b8333c96667a1ef6af9c65c">kGyroscopeVectorNav</a>,</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;};</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeModel.html">   28</a></span>&#160;<span class="keyword">class </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html">GyroscopeModel</a> {</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;  <span class="keyword">virtual</span> ~<a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html">GyroscopeModel</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;  absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a1d4b694ddfd2c0059a68a5d81cd65fd4">Project</a>(</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; omega_sensor_world) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;  absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a2cf159aa7666d16d16039327e09705f2">Unproject</a>(</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; measurement) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a72022d2ea7f3e6a8642a3582b1eab4b0">   47</a></span>&#160;  <span class="keyword">virtual</span> <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a72022d2ea7f3e6a8642a3582b1eab4b0">GetType</a>() <span class="keyword">const</span>  = 0;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a1ecbd16ec4e6d46d908eae26c50adfea">   50</a></span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a1ecbd16ec4e6d46d908eae26c50adfea">NumberOfParameters</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  <span class="comment">// TODO(yangjames): This method should return an absl::StatusOr. Figure out</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;  <span class="comment">//   how to support this using unique_ptr&#39;s, or find macros that already</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  <span class="comment">//   implement this feature (i.e. ASSIGN_OR_RETURN).</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment"></span>  <span class="keyword">static</span> std::unique_ptr&lt;GyroscopeModel&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#acb0d89aed8d6baa8a763f87ead9d91ad">Create</a>(</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;      <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> gyroscope_model);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;};</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">   65</a></span>&#160;<span class="keyword">class </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">GyroscopeScaleOnlyModel</a> : <span class="keyword">public</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html">GyroscopeModel</a> {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  <span class="keyword">static</span> constexpr <span class="keywordtype">int</span> kNumberOfParameters = 1;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="keyword">static</span> constexpr <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> kModelType = <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da34e2be26dca2101fb95fc6487800e928">GyroscopeIntrinsicsModel::kGyroscopeScaleOnly</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">GyroscopeScaleOnlyModel</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;  ~<a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">GyroscopeScaleOnlyModel</a>() <span class="keyword">override</span> = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">GyroscopeScaleOnlyModel</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">GyroscopeScaleOnlyModel</a>&amp;) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a412947e33155cf4e9b5cb7210935ae69">   82</a></span>&#160;  <span class="keyword">static</span> absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a412947e33155cf4e9b5cb7210935ae69">Project</a>(</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; omega_sensor_world) {</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">const</span> T&amp; scale = intrinsics(0);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordflow">return</span> scale * omega_sensor_world;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  }</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#afec9eb1bab22b82898e4899df2a387d0">   95</a></span>&#160;  <span class="keyword">static</span> absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#afec9eb1bab22b82898e4899df2a387d0">Unproject</a>(</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; measurement) {</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keyword">const</span> T&amp; inv_scale = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(1.0) / intrinsics(0);</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordflow">return</span> inv_scale * measurement;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a23a26483438f0df7ecf16bb3b0a5d06c">  102</a></span>&#160;  <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a23a26483438f0df7ecf16bb3b0a5d06c">GetType</a>() const final {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordflow">return</span> kModelType;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  }</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a82ee650cdc0b99d5d7099569313662e0">  106</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a82ee650cdc0b99d5d7099569313662e0">NumberOfParameters</a>() const final {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordflow">return</span> kNumberOfParameters;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;};</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">  114</a></span>&#160;<span class="keyword">class </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">GyroscopeScaleAndBiasModel</a> : <span class="keyword">public</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html">GyroscopeModel</a> {</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  <span class="keyword">static</span> constexpr <span class="keywordtype">int</span> kNumberOfParameters = 4;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;  <span class="keyword">static</span> constexpr <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> kModelType = <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22daebca3599d4b156ca2c552501c98cfd21">GyroscopeIntrinsicsModel::kGyroscopeScaleAndBias</a>;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;  <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">GyroscopeScaleAndBiasModel</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  ~<a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">GyroscopeScaleAndBiasModel</a>() <span class="keyword">override</span> = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">GyroscopeScaleAndBiasModel</a>&amp; operator=(</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;      <span class="keyword">const</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">GyroscopeScaleAndBiasModel</a>&amp;) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160; </div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#a2b2e0611b8331e9ab5996dda0e07a9ac">  130</a></span>&#160;  <span class="keyword">static</span> absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#a2b2e0611b8331e9ab5996dda0e07a9ac">Project</a>(</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; omega_sensor_world) {</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">if</span> (intrinsics.size() != kNumberOfParameters) {</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      <span class="keywordflow">return</span> absl::InvalidArgumentError(absl::StrCat(</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;          <span class="stringliteral">&quot;Invalid gyroscope intrinsics size. Expected &quot;</span>, kNumberOfParameters,</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;          <span class="stringliteral">&quot;, got &quot;</span>, intrinsics.size()));</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    }</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keyword">const</span> T&amp; scale = intrinsics(0);</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">const</span> Eigen::Ref&lt;const Eigen::Vector3&lt;T&gt;&gt; bias =</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        intrinsics.segment(1, 3);</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="keywordflow">return</span> scale * omega_sensor_world + bias;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;  }</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#ade7e2c5c6c6d1c0d013b1b7806cd9e86">  151</a></span>&#160;  <span class="keyword">static</span> absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#ade7e2c5c6c6d1c0d013b1b7806cd9e86">Unproject</a>(</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; measurement) {</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keywordflow">if</span> (intrinsics.size() != kNumberOfParameters) {</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;      <span class="keywordflow">return</span> absl::InvalidArgumentError(absl::StrCat(</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;          <span class="stringliteral">&quot;Invalid gyroscope intrinsics size. Expected &quot;</span>, kNumberOfParameters,</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;          <span class="stringliteral">&quot;, got &quot;</span>, intrinsics.size()));</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    }</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keyword">const</span> T&amp; inv_scale = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(1.0) / intrinsics(0);</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <span class="keyword">const</span> Eigen::Ref&lt;const Eigen::Vector3&lt;T&gt;&gt; bias =</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        intrinsics.segment(1, 3);</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordflow">return</span> inv_scale * (measurement - bias);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;  }</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160; </div>
<div class="line"><a name="l00165"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#a2da8af552ed6f172e70115010788ddff">  165</a></span>&#160;  <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#a2da8af552ed6f172e70115010788ddff">GetType</a>() const final {</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordflow">return</span> kModelType;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  }</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#aef9eed7ab47f29a01f814eee5a4656d0">  169</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#aef9eed7ab47f29a01f814eee5a4656d0">NumberOfParameters</a>() const final {</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keywordflow">return</span> kNumberOfParameters;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  }</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;};</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160; </div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">  180</a></span>&#160;<span class="keyword">class </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">GyroscopeVectorNavModel</a> : <span class="keyword">public</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html">GyroscopeModel</a> {</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;  <span class="keyword">static</span> constexpr <span class="keywordtype">int</span> kNumberOfParameters = 12;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;  <span class="keyword">static</span> constexpr <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> kModelType = <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da81a678b12b8333c96667a1ef6af9c65c">GyroscopeIntrinsicsModel::kGyroscopeVectorNav</a>;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  <a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">GyroscopeVectorNavModel</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  ~<a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">GyroscopeVectorNavModel</a>() <span class="keyword">override</span> = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  <a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">GyroscopeVectorNavModel</a>&amp; operator=(</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;      <span class="keyword">const</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">GyroscopeVectorNavModel</a>&amp;) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00208"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#ae7736c1b942b6b21c352bada85bdadc8">  208</a></span>&#160;  <span class="keyword">static</span> absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#ae7736c1b942b6b21c352bada85bdadc8">Project</a>(</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; omega_sensor_world) {</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    <span class="keywordflow">if</span> (intrinsics.size() != kNumberOfParameters) {</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;      <span class="keywordflow">return</span> absl::InvalidArgumentError(absl::StrCat(</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;          <span class="stringliteral">&quot;Invalid gyroscope intrinsics size. Expected &quot;</span>, kNumberOfParameters,</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;          <span class="stringliteral">&quot;, got &quot;</span>, intrinsics.size()));</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    }</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <span class="keyword">const</span> T&amp; sx = intrinsics(0);</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="keyword">const</span> T&amp; sy = intrinsics(1);</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="keyword">const</span> T&amp; sz = intrinsics(2);</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keyword">const</span> T&amp; a1 = intrinsics(3);</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    <span class="keyword">const</span> T&amp; a2 = intrinsics(4);</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keyword">const</span> T&amp; a3 = intrinsics(5);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="keyword">const</span> T&amp; a4 = intrinsics(6);</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keyword">const</span> T&amp; a5 = intrinsics(7);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keyword">const</span> T&amp; a6 = intrinsics(8);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="keyword">const</span> T&amp; bx = intrinsics(9);</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="keyword">const</span> T&amp; by = intrinsics(10);</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <span class="keyword">const</span> T&amp; bz = intrinsics(11);</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    <span class="keyword">const</span> T&amp; wx = omega_sensor_world.x();</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    <span class="keyword">const</span> T&amp; wy = omega_sensor_world.y();</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <span class="keyword">const</span> T&amp; wz = omega_sensor_world.z();</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="keyword">const</span> T fx = bx + sx * (wx + a1 * wy + a2 * wz);</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <span class="keyword">const</span> T fy = by + sy * (wy + a3 * wx + a4 * wz);</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    <span class="keyword">const</span> T fz = bz + sz * (wz + a5 * wx + a6 * wy);</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;    <span class="keywordflow">return</span> Eigen::Vector3&lt;T&gt;(fx, fy, fz);</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;  }</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160; </div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#a367b1544da875a905345519aa565ca0b">  256</a></span>&#160;  <span class="keyword">static</span> absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#a367b1544da875a905345519aa565ca0b">Unproject</a>(</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;      <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;      <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; measurement) {</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;    <span class="keywordflow">if</span> (intrinsics.size() != kNumberOfParameters) {</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;      <span class="keywordflow">return</span> absl::InvalidArgumentError(absl::StrCat(</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;          <span class="stringliteral">&quot;Invalid gyroscope intrinsics size. Expected &quot;</span>, kNumberOfParameters,</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;          <span class="stringliteral">&quot;, got &quot;</span>, intrinsics.size()));</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    <span class="keyword">const</span> T&amp; sx = intrinsics(0);</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="keyword">const</span> T&amp; sy = intrinsics(1);</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    <span class="keyword">const</span> T&amp; sz = intrinsics(2);</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    <span class="keyword">const</span> T&amp; a1 = intrinsics(3);</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    <span class="keyword">const</span> T&amp; a2 = intrinsics(4);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <span class="keyword">const</span> T&amp; a3 = intrinsics(5);</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    <span class="keyword">const</span> T&amp; a4 = intrinsics(6);</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    <span class="keyword">const</span> T&amp; a5 = intrinsics(7);</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    <span class="keyword">const</span> T&amp; a6 = intrinsics(8);</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <span class="keyword">const</span> T&amp; fx = measurement.x();</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    <span class="keyword">const</span> T&amp; fy = measurement.y();</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    <span class="keyword">const</span> T&amp; fz = measurement.z();</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <span class="keyword">const</span> Eigen::Vector3&lt;T&gt; bias(intrinsics(9), intrinsics(10), intrinsics(11));</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    <span class="keyword">const</span> Eigen::Vector3&lt;T&gt; d = bias - measurement;</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="keyword">const</span> T det_A =</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;      1.0 - a1*a3 - a2*a5 - a4*a6 + a1*a4*a5 + a2*a3*a6;</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    <span class="keyword">const</span> T dx_inv_sx_detA = d.x() / (sx * det_A);</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    <span class="keyword">const</span> T dy_inv_sy_detA = d.y() / (sy * det_A);</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="keyword">const</span> T dz_inv_sz_detA = d.z() / (sz * det_A);</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <span class="keyword">const</span> T wx = (a4*a6 - 1) * dx_inv_sx_detA + (a1 - a2*a6) * dy_inv_sy_detA +</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;        (a2 - a1*a4) * dz_inv_sz_detA;</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    <span class="keyword">const</span> T wy = (a2*a5 - 1) * dy_inv_sy_detA + (a3 - a4*a5) * dx_inv_sx_detA +</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;        (a4 - a2*a3) * dz_inv_sz_detA;</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    <span class="keyword">const</span> T wz = (a1*a3 - 1) * dz_inv_sz_detA + (a5 - a3*a6) * dx_inv_sx_detA +</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;        (a6 - a1*a5) * dy_inv_sy_detA;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <span class="keywordflow">return</span> Eigen::Vector3&lt;T&gt;(wx, wy, wz);</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;  }</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#a5f69f94fd29082510acf16faae1e5f89">  292</a></span>&#160;  <a class="code" href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">GyroscopeIntrinsicsModel</a> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#a5f69f94fd29082510acf16faae1e5f89">GetType</a>() const final {</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="keywordflow">return</span> kModelType;</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;  }</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160; </div>
<div class="line"><a name="l00296"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#aa4e7ecd6ddcfb97551367e14fa6de09b">  296</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#aa4e7ecd6ddcfb97551367e14fa6de09b">NumberOfParameters</a>() const final {</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    <span class="keywordflow">return</span> kNumberOfParameters;</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;  }</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;};</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160; </div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160; </div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160; </div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00304"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a1d4b694ddfd2c0059a68a5d81cd65fd4">  304</a></span>&#160;absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a1d4b694ddfd2c0059a68a5d81cd65fd4">GyroscopeModel::Project</a>(</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; omega_sensor_world)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;  <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> derived = <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">GyroscopeScaleOnlyModel</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)) {</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <span class="keywordflow">return</span> derived-&gt;Project(intrinsics, omega_sensor_world);</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;  }</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;  <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> derived =</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;          <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">GyroscopeScaleAndBiasModel</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)) {</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <span class="keywordflow">return</span> derived-&gt;Project(intrinsics, omega_sensor_world);</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;  }</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;  <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> derived =</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;          <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">GyroscopeVectorNavModel</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)) {</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    <span class="keywordflow">return</span> derived-&gt;Project(intrinsics, omega_sensor_world);</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;  }</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;  <span class="keywordflow">return</span> absl::InvalidArgumentError(absl::StrCat(</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;      <span class="stringliteral">&quot;Project for gyroscope model &quot;</span>, this-&gt;<a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a72022d2ea7f3e6a8642a3582b1eab4b0">GetType</a>(), <span class="stringliteral">&quot; not supported.&quot;</span>));</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;}</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160; </div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00323"></a><span class="lineno"><a class="line" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a2cf159aa7666d16d16039327e09705f2">  323</a></span>&#160;absl::StatusOr&lt;Eigen::Vector3&lt;T&gt;&gt; <a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a2cf159aa7666d16d16039327e09705f2">GyroscopeModel::Unproject</a>(</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    <span class="keyword">const</span> Eigen::VectorX&lt;T&gt;&amp; intrinsics,</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    <span class="keyword">const</span> Eigen::Vector3&lt;T&gt;&amp; measurement)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;  <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> derived = <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">GyroscopeScaleOnlyModel</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)) {</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;    <span class="keywordflow">return</span> derived-&gt;Unproject(intrinsics, measurement);</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  }</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> derived =</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;          <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">GyroscopeScaleAndBiasModel</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)) {</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    <span class="keywordflow">return</span> derived-&gt;Unproject(intrinsics, measurement);</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  }</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;  <span class="keywordflow">if</span> (<span class="keyword">const</span> <span class="keyword">auto</span> derived =</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;          <span class="keyword">dynamic_cast&lt;</span><span class="keyword">const </span><a class="code" href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">GyroscopeVectorNavModel</a>*<span class="keyword">&gt;</span>(<span class="keyword">this</span>)) {</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    <span class="keywordflow">return</span> derived-&gt;Unproject(intrinsics, measurement);</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;  }</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;  <span class="keywordflow">return</span> absl::InvalidArgumentError(absl::StrCat(</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;      <span class="stringliteral">&quot;Unproject for gyroscope model &quot;</span>, this-&gt;<a class="code" href="classcalico_1_1sensors_1_1GyroscopeModel.html#a72022d2ea7f3e6a8642a3582b1eab4b0">GetType</a>(), <span class="stringliteral">&quot; not supported.&quot;</span>));</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;}</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160; </div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;} <span class="comment">// namespace calico::sensors</span></div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160; </div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// CALICO_SENSORS_GYROSCOPE_MODELS_H_</span></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeModel_html"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeModel.html">calico::sensors::GyroscopeModel</a></div><div class="ttdoc">Base class for gyroscope models.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:28</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeModel_html_a1d4b694ddfd2c0059a68a5d81cd65fd4"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeModel.html#a1d4b694ddfd2c0059a68a5d81cd65fd4">calico::sensors::GyroscopeModel::Project</a></div><div class="ttdeci">absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Project(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;omega_sensor_world) const</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:304</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeModel_html_a1ecbd16ec4e6d46d908eae26c50adfea"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeModel.html#a1ecbd16ec4e6d46d908eae26c50adfea">calico::sensors::GyroscopeModel::NumberOfParameters</a></div><div class="ttdeci">virtual int NumberOfParameters() const =0</div><div class="ttdoc">Getter for the number of parameters for this model.</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeModel_html_a2cf159aa7666d16d16039327e09705f2"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeModel.html#a2cf159aa7666d16d16039327e09705f2">calico::sensors::GyroscopeModel::Unproject</a></div><div class="ttdeci">absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Unproject(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;measurement) const</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:323</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeModel_html_a72022d2ea7f3e6a8642a3582b1eab4b0"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeModel.html#a72022d2ea7f3e6a8642a3582b1eab4b0">calico::sensors::GyroscopeModel::GetType</a></div><div class="ttdeci">virtual GyroscopeIntrinsicsModel GetType() const =0</div><div class="ttdoc">Getter for gyroscope model type.</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeModel_html_acb0d89aed8d6baa8a763f87ead9d91ad"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeModel.html#acb0d89aed8d6baa8a763f87ead9d91ad">calico::sensors::GyroscopeModel::Create</a></div><div class="ttdeci">static std::unique_ptr&lt; GyroscopeModel &gt; Create(GyroscopeIntrinsicsModel gyroscope_model)</div><div class="ttdef"><b>Definition:</b> gyroscope_models.cpp:5</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleAndBiasModel_html"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html">calico::sensors::GyroscopeScaleAndBiasModel</a></div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:114</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleAndBiasModel_html_a2b2e0611b8331e9ab5996dda0e07a9ac"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#a2b2e0611b8331e9ab5996dda0e07a9ac">calico::sensors::GyroscopeScaleAndBiasModel::Project</a></div><div class="ttdeci">static absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Project(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;omega_sensor_world)</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:130</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleAndBiasModel_html_a2da8af552ed6f172e70115010788ddff"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#a2da8af552ed6f172e70115010788ddff">calico::sensors::GyroscopeScaleAndBiasModel::GetType</a></div><div class="ttdeci">GyroscopeIntrinsicsModel GetType() const final</div><div class="ttdoc">Getter for gyroscope model type.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:165</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleAndBiasModel_html_ade7e2c5c6c6d1c0d013b1b7806cd9e86"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#ade7e2c5c6c6d1c0d013b1b7806cd9e86">calico::sensors::GyroscopeScaleAndBiasModel::Unproject</a></div><div class="ttdeci">static absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Unproject(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;measurement)</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:151</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleAndBiasModel_html_aef9eed7ab47f29a01f814eee5a4656d0"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleAndBiasModel.html#aef9eed7ab47f29a01f814eee5a4656d0">calico::sensors::GyroscopeScaleAndBiasModel::NumberOfParameters</a></div><div class="ttdeci">int NumberOfParameters() const final</div><div class="ttdoc">Getter for the number of parameters for this model.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:169</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleOnlyModel_html"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html">calico::sensors::GyroscopeScaleOnlyModel</a></div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:65</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleOnlyModel_html_a23a26483438f0df7ecf16bb3b0a5d06c"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a23a26483438f0df7ecf16bb3b0a5d06c">calico::sensors::GyroscopeScaleOnlyModel::GetType</a></div><div class="ttdeci">GyroscopeIntrinsicsModel GetType() const final</div><div class="ttdoc">Getter for gyroscope model type.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:102</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleOnlyModel_html_a412947e33155cf4e9b5cb7210935ae69"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a412947e33155cf4e9b5cb7210935ae69">calico::sensors::GyroscopeScaleOnlyModel::Project</a></div><div class="ttdeci">static absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Project(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;omega_sensor_world)</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:82</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleOnlyModel_html_a82ee650cdc0b99d5d7099569313662e0"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#a82ee650cdc0b99d5d7099569313662e0">calico::sensors::GyroscopeScaleOnlyModel::NumberOfParameters</a></div><div class="ttdeci">int NumberOfParameters() const final</div><div class="ttdoc">Getter for the number of parameters for this model.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:106</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeScaleOnlyModel_html_afec9eb1bab22b82898e4899df2a387d0"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeScaleOnlyModel.html#afec9eb1bab22b82898e4899df2a387d0">calico::sensors::GyroscopeScaleOnlyModel::Unproject</a></div><div class="ttdeci">static absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Unproject(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;measurement)</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:95</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeVectorNavModel_html"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html">calico::sensors::GyroscopeVectorNavModel</a></div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:180</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeVectorNavModel_html_a367b1544da875a905345519aa565ca0b"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#a367b1544da875a905345519aa565ca0b">calico::sensors::GyroscopeVectorNavModel::Unproject</a></div><div class="ttdeci">static absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Unproject(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;measurement)</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:256</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeVectorNavModel_html_a5f69f94fd29082510acf16faae1e5f89"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#a5f69f94fd29082510acf16faae1e5f89">calico::sensors::GyroscopeVectorNavModel::GetType</a></div><div class="ttdeci">GyroscopeIntrinsicsModel GetType() const final</div><div class="ttdoc">Getter for gyroscope model type.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:292</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeVectorNavModel_html_aa4e7ecd6ddcfb97551367e14fa6de09b"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#aa4e7ecd6ddcfb97551367e14fa6de09b">calico::sensors::GyroscopeVectorNavModel::NumberOfParameters</a></div><div class="ttdeci">int NumberOfParameters() const final</div><div class="ttdoc">Getter for the number of parameters for this model.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:296</div></div>
<div class="ttc" id="aclasscalico_1_1sensors_1_1GyroscopeVectorNavModel_html_ae7736c1b942b6b21c352bada85bdadc8"><div class="ttname"><a href="classcalico_1_1sensors_1_1GyroscopeVectorNavModel.html#ae7736c1b942b6b21c352bada85bdadc8">calico::sensors::GyroscopeVectorNavModel::Project</a></div><div class="ttdeci">static absl::StatusOr&lt; Eigen::Vector3&lt; T &gt; &gt; Project(const Eigen::VectorX&lt; T &gt; &amp;intrinsics, const Eigen::Vector3&lt; T &gt; &amp;omega_sensor_world)</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:208</div></div>
<div class="ttc" id="anamespacecalico_1_1sensors_html"><div class="ttname"><a href="namespacecalico_1_1sensors.html">calico::sensors</a></div><div class="ttdoc">Sensors namespace.</div><div class="ttdef"><b>Definition:</b> accelerometer.cpp:8</div></div>
<div class="ttc" id="anamespacecalico_1_1sensors_html_a3a17fd4af1cc53c28ec7130fdad5f22d"><div class="ttname"><a href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22d">calico::sensors::GyroscopeIntrinsicsModel</a></div><div class="ttdeci">GyroscopeIntrinsicsModel</div><div class="ttdoc">Gyroscope model types.</div><div class="ttdef"><b>Definition:</b> gyroscope_models.h:16</div></div>
<div class="ttc" id="anamespacecalico_1_1sensors_html_a3a17fd4af1cc53c28ec7130fdad5f22da34e2be26dca2101fb95fc6487800e928"><div class="ttname"><a href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da34e2be26dca2101fb95fc6487800e928">calico::sensors::GyroscopeIntrinsicsModel::kGyroscopeScaleOnly</a></div><div class="ttdeci">@ kGyroscopeScaleOnly</div><div class="ttdoc">Isotropic scale without bias.</div></div>
<div class="ttc" id="anamespacecalico_1_1sensors_html_a3a17fd4af1cc53c28ec7130fdad5f22da35c3ace1970663a16e5c65baa5941b13"><div class="ttname"><a href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da35c3ace1970663a16e5c65baa5941b13">calico::sensors::GyroscopeIntrinsicsModel::kNone</a></div><div class="ttdeci">@ kNone</div><div class="ttdoc">Default no model.</div></div>
<div class="ttc" id="anamespacecalico_1_1sensors_html_a3a17fd4af1cc53c28ec7130fdad5f22da81a678b12b8333c96667a1ef6af9c65c"><div class="ttname"><a href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22da81a678b12b8333c96667a1ef6af9c65c">calico::sensors::GyroscopeIntrinsicsModel::kGyroscopeVectorNav</a></div><div class="ttdeci">@ kGyroscopeVectorNav</div><div class="ttdoc">VectorNav model.</div></div>
<div class="ttc" id="anamespacecalico_1_1sensors_html_a3a17fd4af1cc53c28ec7130fdad5f22daebca3599d4b156ca2c552501c98cfd21"><div class="ttname"><a href="namespacecalico_1_1sensors.html#a3a17fd4af1cc53c28ec7130fdad5f22daebca3599d4b156ca2c552501c98cfd21">calico::sensors::GyroscopeIntrinsicsModel::kGyroscopeScaleAndBias</a></div><div class="ttdeci">@ kGyroscopeScaleAndBias</div><div class="ttdoc">Isotropic scale with bias.</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
